home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 019a / amac40.zip / RFR001.QM < prev    next >
Text File  |  1991-08-01  |  12KB  |  233 lines

  1. *                               RFR001.QM
  2. *                        Written By Tom Hogshead
  3. *                       [ See RFRMxx.QM For Use ]
  4. *                             August 1, 1991
  5. *  Key       Subfile                       Description
  6. * =====  ===============  ====================================================
  7. * @(F8)                   Makes All Blank Lines In Document Single Space,
  8. *                        "Lightning Fast!" (Condenses for better readability)
  9. * @(F7)                   SINGLE Space Document, "Slow"
  10. * @(g)                    SINGLE Space Document, "Lightning Fast!"
  11. * @(F9)                   DOUBLE Space Document, "Lightning Fast!"
  12. * @(F0)                   TRIPLE Space Document, "Lightning Fast!"
  13. *
  14. *          {e:\up\RFRM*}--Return To RFRMxx.QM
  15. *
  16. *-- eoi
  17.  
  18. * 
  19. * ----------------------------------------------------------------------
  20. * @(F7) Deletes ALL BLANK lines in document, slow
  21. * ----------------------------------------------------------------------
  22.  
  23. * Single space document.  See @g below for "Lightning Fast" version.
  24.  
  25. @f7 Macrobegin
  26.         Begfile                         * Go to bof
  27.  CHK4BLANK:                             *
  28.         Endline Begline                 * Check if line has text
  29.         Jtrue  NOTBLANK:                * If so, go to NOTBLANK
  30.         Delline                         * Or line is blank, delete it
  31.         Jtrue CHK4BLANK:                * Go check next line
  32.  NOTBLANK:                              *ELSE
  33.         Endpara                         * Move to paragraph end
  34.         Cursordown                      * Move down to blank line
  35.         Jtrue CHK4BLANK:                * If not eof, check again
  36.         Begfile                         * Go to bof
  37. *
  38. * 20 bytes Wed  02-20-1991  16:48:58
  39.  
  40. * 
  41. * ------------------------------------------------------------------------
  42. * @(g)  Single Space Document, Uses Windows, Lightning Fast!
  43. * ------------------------------------------------------------------------
  44.  
  45. * Using the windows approach, @g is "Lightning Fast" compared to @F7;
  46. * on a 199 line double spaced file, 10,198 bytes, run times were:
  47.  
  48. *                   Seconds
  49. *             @F7     13
  50. *             @g       2 (6 times faster)
  51.  
  52. @g macrobegin
  53.         Begfile                         * Start at file begin
  54.         onewindow horizontalwindow      * Make two windows
  55.         editfile escape                 * For all QConfig's
  56.         shrinkwindow                    * Shrink window
  57.         cursordown cursordown cursordown*
  58.         cursordown cursordown cursordown*
  59.         cursordown cursordown cursordown*
  60.         escape                          *
  61.         prevfile                        * Starting file in window 2
  62.     CHK4BLANK:                          *
  63.         Endline Begline                 * Test if line has text
  64.         Jtrue  NOTBLANK:                * If it has text, go to NOTBLANK
  65.         Delline                         *ELSE line is blank, delete it
  66.         Jtrue CHK4BLANK:                *ELSE line has text
  67.     NOTBLANK:                           *
  68.         Endpara                         * Move to paragraph end
  69.         Cursordown                      * Move down to blank line
  70.         Jtrue CHK4BLANK:                * We're done if eof, else test again
  71.         Begfile                         * File begin when done
  72.         onewindow                       * Close all windows
  73. *
  74. * 20 bytes Wed  02-20-1991  16:48:58 (TH @f7)
  75. * 37 bytes Tue  07-02-1991  16:20:47 (TH @g, added windows)
  76.  
  77. * 
  78. * ----------------------------------------------------------------------------
  79. * @(F8) Makes All Blank Lines In Document Single Space, "Lightning Fast"
  80. * ----------------------------------------------------------------------------
  81.  
  82. * This macro is handy for condensing documents, so that there are
  83. * only single blank lines between text for better screen readability.
  84.  
  85. @F8 Macrobegin
  86.         Begfile                         * Start at file begin
  87.         onewindow horizontalwindow      * Make two windows
  88.         editfile escape                 * For all QConfig's
  89.         shrinkwindow                    * Shrink window
  90.         cursordown cursordown cursordown*
  91.         cursordown cursordown cursordown*
  92.         cursordown cursordown cursordown*
  93.         escape                          *
  94.         prevfile                        * Starting file in window 2
  95.  CHK4BLANK:                             *
  96.         Endline Begline                 * Test if line has text
  97.         Jtrue  NOTBLANK:                * If it has text, go to NOTBLANK
  98.         Delline                         *ELSE line is blank, delete it
  99.         Jtrue CHK4BLANK:                * Test if this line is blank
  100.  NOTBLANK:                              *ELSE line has text
  101.         Endpara                         * Move to paragraph end
  102.         Cursordown                      * Move to blank line 1
  103.         Cursordown                      * And down one more line
  104.         Jtrue CHK4BLANK:                * We're done if eof, else test again
  105.         Begfile                         * File begin when done
  106.         onewindow                       * Close all windows
  107. *
  108. * 21 bytes Wed  02-20-1991  16:46:39
  109. * 38 bytes Sun  07-14-1991  17:36:39 (TH @F8, added windows)
  110.                                                                     
  111. * 
  112. *------------------------------------------------
  113. * @(F9) Double Space document, "Lightning Fast!"
  114. *------------------------------------------------
  115. *
  116. * With cursor anywhere in a document, press @F9 and document will
  117. * be double spaced with a single blank line between each text line.
  118. *
  119. * Removing the five lines marked with ** in the @f10 macro below will
  120. * also double space a document like @F9 does.
  121. *
  122. @F9 Macrobegin
  123.         Begfile                         * Start at file begin
  124.         onewindow horizontalwindow      * Make two windows
  125.         editfile escape                 * For all QConfig's
  126.         shrinkwindow                    * Shrink window
  127.         cursordown cursordown cursordown*
  128.         cursordown cursordown cursordown*
  129.         cursordown cursordown cursordown*
  130.         escape                          *
  131.         prevfile                        * Starting file in window 2
  132.  START:         Endline Begline         * ? if line has text
  133.                 Jfalse DEL_BLANK:       * No text, go to DEL_BLANK:
  134.     INS_BLANK: *----------------Insert Blank Line LOOP-----------------*
  135.                                         *ELSE line is not blank, and
  136.                 Cursordown              * Move down to check next line
  137.                 Jfalse END:             * If at eof, END macro
  138.                                         *
  139.                 Endline Begline         *ELSE ? if next line has text
  140.                 Jfalse NEXT_LINE:       * No text, go to NEXT_LINE
  141.                                         *ELSE line is not blank, and
  142.                 Insertline              * Insert blank line between
  143.                                         * two text lines
  144.                 Cursordown              * Move down to next line
  145.     Jump INS_BLANK:                     * Go check this line for text
  146.     NEXT_LINE:  Cursordown              * Move down to check next line
  147.  Jump START:                            * Go check line for text
  148.     DEL_BLANK: *---------Delete More Than One Blank Line LOOP----------*
  149.                 Cursordown              * Move down to check if eof
  150.                 Jfalse END:             * If at eof, END macro
  151.                                         *ELSE not yet at eof, and
  152.                 Cursorup                * Move back up to second blank
  153.                 Delline                 * line and delete it
  154.  Jump START:                            * Go check line for text
  155.  END:                                   *
  156.                 Begfile                 *
  157.                 onewindow               * Close all windows
  158. *
  159. * 38 bytes Fri  02-22-1991  13:22:05
  160. * 55 bytes Sun  07-14-1991  17:45:16 (TH @F9, added windows)
  161.  
  162. * 
  163. *---------------------------------------------------
  164. * @(F0) Triple space document, "Lightning Fast!"
  165. *---------------------------------------------------
  166. *
  167. * With cursor anywhere in a document, press @F10 and document will
  168. * be triple spaced with two blank lines between each text line.
  169. *
  170. * Removing the four lines marked with ** in this macro will double space
  171. * a document like @F9 (a simpler shorter macro) does.
  172. *
  173. @F10 Macrobegin
  174.         Begfile                         * Start at file begin
  175.         onewindow horizontalwindow      * Make two windows
  176.         editfile escape                 * For all QConfig's
  177.         shrinkwindow                    * Shrink window
  178.         cursordown cursordown cursordown*
  179.         cursordown cursordown cursordown*
  180.         cursordown cursordown cursordown*
  181.         escape                          *
  182.         prevfile                        * Starting file in window 2
  183.  INITIAL:   *----------Delete All Blanks lines on Top LOOP-------------*
  184.                 Endline Begline         * ? if top line has text
  185.                 Jtrue START:            * If text line, go to START
  186.                 Delline                 *ELSE delete line
  187.  Jump INITIAL:                          * and continue until no blank
  188.                                         * lines on top
  189.  START:     *--------------Check Line For Text LOOP--------------------*
  190.                 Endline Begline         * ? if line has text
  191.                 Jfalse DEL_BLANK:       * No text, go to DEL_BLANK:
  192.     INS_BLANK: *----------------Insert Blank Line LOOP-----------------*
  193.                                         *ELSE line is not blank, and
  194.                 Cursordown              * Down to next line
  195.                 Jfalse END:             * If at eof, END macro
  196.                 Endline Begline         * ? if next line has text
  197.                 Jfalse DEL_BLANK:       * If line blank.  go check next
  198.                                         * line
  199.                                         *ELSE line is not blank, then
  200.                 Insertline              * insert blank line
  201.                 Addline                ** And another
  202.                 Cursordown              * Move down to next line
  203.     Jump INS_BLANK:                     * Go check next line for text
  204.     DEL_BLANK: *-----------------Delete Blank Line LOOP----------------*
  205.                 Cursordown              * Move down off first blank line
  206.                 Jfalse END:             * If at eof, END macro
  207.                                         *ELSE not yet at eof, and
  208.                 Endline Begline         * Check line for text
  209.                 Jfalse CONTINUE:        * If blank, go to CONTINUE:
  210.                 Insertline             **ELSE must be text line and
  211.                                         * insertline blank #2
  212.                 Cursordown             ** Down to text line
  213.     Jump INS_BLANK:                     * Go check next line
  214.     CONTINUE:
  215.                 Cursordown             ** Move down to next line
  216.     NEXT:      *---------Delete More Than 2 blank lines LOOP-----------*
  217.                 Endline Begline         * Check line for text
  218.                 Jtrue INS_BLANK:        * If text, go check next line
  219.                                         * for text
  220.                                         *ELSE line is blank
  221.                 Delline                 * and delete it
  222.                 Jfalse END:             * If at eof, can't delete more
  223.                                         * than 1 blank line, then END
  224.     Jump NEXT:                          * Loop to delete blank lines
  225.                                         * until text line
  226.  END:                                   * Here to END
  227.                 Begfile                 *
  228.                 onewindow               * Close all windows
  229. *
  230. * 62 bytes Sun  02-24-1991  13:33:59
  231. * 79 bytes Sun  07-14-1991  17:48:05 (TH @F10, added windows)
  232.  
  233.